<?php
echo '<div class="vcard">';
//pr($m);
  $display = '';
  if ($m['business_name']) {
    $display .= '<span class="fn org">' . $m['business_name'] . '</span>' . "\n";
    if ($m['work_address_line1']) {
    	$display .= '<span class="adr">' . "\n";
    	$display .= "<span class='type'>Work</span> address:" . "\n";
    	$display .= "<div class='street-address'>". $m['work_address_line1'] ."</div>\n" . "\n";
    	if ($m['work_address_line2']){ 
    	  $display .= "<div class='extended-address'>". $m['work_address_line2'] ."</div>\n";
    	}
			
    	$display .= "<div><span class='locality'>". $m['work_city'] ."</span> <span class='region'>". $m['work_state'] ."</span>, <span class='postal-code'>". $m['work_zip'] ."</span></div>\n";
    	$display .= "</span>\n";
    }
    if ($m['work_phone']) {
      $display .= "<span class='tel'><span class='value'>" . $m['work_phone'] . "</span> (<span class='type'>work</span>)</span>\n";
    }
    if ($m['fax']){ 
      $display .= "<span class='tel'><span class='value'>" . $m['fax'] . "</span> (<span class='type'>fax</span>)</span>\n";
    }
    $display .="</div>\n<div class='vcard'>";
  }
  $i = ($m['votes']) ? $html->image('interface/silk/comment.png') : '';
  $display .= '<div class="fn n"><span class="given-name">' . $m['first_name'] . '</span> <span class="family-name">' . $m['last_name'] . '</span>' . $i . '</div>' . "\n";
  if ($m['address_line1']) {
  	$display .= "<span class='adr'>" . "\n";
  	$display .= "<span class='type'>Home</span> address:" . "\n";
  	$display .= "<div class='street-address'>". $m['address_line1'] ."</div>\n";
  	if ($m['address_line2']){ 
  	  $display .= "<div class='extended-address'>". $m['address_line2'] ."</div>\n";
  	}
		
  	$display .= "<div><span class='locality'>". $m['city'] ."</span>, <span class='region'>". $m['state'] ."</span> <span class='postal-code'>". $m['zip'] ."</span></div></span>\n";
  }

  if ($m['email_address']){
    $display .= $html->link($m['email_address'],'mailto:'.$m['email_address'],array('class'=>'email'));
  }

	if ($m['email_address_2']){
    $display .= $html->link($m['email_address_2'],'mailto:'.$m['email_address_2'],array('class'=>'email'));
  }
		
	if ($m['home_phone']){ 
		$display .= "<span class='tel'><span class='value'>" . $m['home_phone'] . "</span> (<span class='type'>home</span>)</span>\n"; 
	}
		
	if ($m['work_phone']){ 
		$display .= "<span class='tel'><span class='value'>" . $m['work_phone'] . "</span> (<span class='type'>work</span>)</span>\n";
	}
		
	if ($m['mobile_phone']){
		$display .= "<span class='tel'><span class='value'>" . $m['mobile_phone'] . "</span> (<span class='type'>cell</span>)</span>\n"; 
	}
	
	if ($m['fax']){ 
		$display .= "<span class='tel'><span class='value'>" . $m['fax'] . "</span> (<span class='type'>fax</span>)</span>\n";
	}
    
	//	return $display;
	$display .= "<div class='membership-date'>Member Since: " . $m['membership_date'] . "</div>\n";
	$display .= '<p>Paid Through: ' . date('Y-m-d', strtotime($m['paid_fee'] . ' +1 year')) . '</p>';
echo $display;
echo '</div>';
?>
